﻿package WebRoot.demo2.entity;


import org.hoyi.DB.comment.DbAttrANNO;
import org.hoyi.DB.comment.EntityAttrANNO;
import org.hoyi.DB.comment.datatype;
import org.hoyi.DB.ctrl.HOYI;
import org.hoyi.DB.ctrl.HOYICMD;
import org.hoyi.DB.ents.Entity;
import org.hoyi.DB.model.AttField;


/**
*  实体类 user 属性说明自动提取数据库字段的描述信息.
*/
@EntityAttrANNO(tablename="user", comment="user")
public class user extends Entity{
	//#region 静态字段
	/// <summary>
	/// 用户id
	/// </summary>
	public static AttField id = new AttField("id");		
	/// <summary>
	/// 用户名
	/// </summary>
	public static AttField username = new AttField("username");		
	/// <summary>
	/// 性别
	/// </summary>
	public static AttField sex = new AttField("sex");		
	/// <summary>
	/// 记录
	/// </summary>
	public static AttField note = new AttField("note");		
	   
	//#endregion 静态字段
	
	
	//#region 字段
	/// <summary>
	/// 用户id
	/// </summary>	
	@DbAttrANNO(type=datatype.Int,  Length = 11, Comment = "用户id", FieldName = "id",isPK= true,Identity=true)
	public String Id ;		

	/// <summary>
	/// 用户名
	/// </summary>	
	@DbAttrANNO(type=datatype.Varchar,  Length = 20, Comment = "用户名", FieldName = "username")
	public String Username ;		

	/// <summary>
	/// 性别
	/// </summary>	
	@DbAttrANNO(type=datatype.Int,  Length = 3, Comment = "性别", FieldName = "sex")
	public String Sex ;		

	/// <summary>
	/// 记录
	/// </summary>	
	@DbAttrANNO(type=datatype.Varchar,  Length = 20, Comment = "记录", FieldName = "note")
	public String Note ;		

	 
	
	
	/// <summary>
	/// 用户id
	/// </summary>	
	
	public String getId(){
		if(this.Id == null)
			return "";
		return this.Id;
	}
	
	public void setId(String _id)
	{
		this.Id = _id;
		
	}
	/// <summary>
	/// 用户名
	/// </summary>	
	
	public String getUsername(){
		if(this.Username == null)
			return "";
		return this.Username;
	}
	
	public void setUsername(String _username)
	{
		this.Username = _username;
		
	}
	/// <summary>
	/// 性别
	/// </summary>	
	
	public String getSex(){
		if(this.Sex == null)
			return "";
		return this.Sex;
	}
	
	public void setSex(String _sex)
	{
		this.Sex = _sex;
		
	}
	/// <summary>
	/// 记录
	/// </summary>	
	
	public String getNote(){
		if(this.Note == null)
			return "";
		return this.Note;
	}
	
	public void setNote(String _note)
	{
		this.Note = _note;
		
	}
	 
	//#endregion 字段
	
				
	public static user NEW(){
		return new user();
	} 
	
	public user() {
	}
	
	public user( String _username ,  String _sex ,  String _note ){
		 this.Username =  _username;
		 this.Sex =  _sex;
		 this.Note =  _note;
		
	}	
	
	public user( String _id ,  String _username ,  String _sex ,  String _note ){
		 this.Id =  _id;
		 this.Username =  _username;
		 this.Sex =  _sex;
		 this.Note =  _note;
		
	}	
	
	//#region 语法所迫, 初始化命令.
	
	public static HOYICMD E() {
			return HOYI.E(user.class);
	}
	
	@Override
	public String getFirstfield() {
		// TODO Auto-generated method stub
		return "id";
	}
	
	@Override
	public String getSecondfield() {
		// TODO Auto-generated method stub
		return "username";
	}

	//#endregion 语法所迫, 初始化命令.
}
